package com.dl.code.service.impl;

import com.dl.code.entity.Permission;
import com.dl.code.mapper.PermissionMapper;
import com.dl.code.service.PermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * 作者: DL代先生
 * 日期: 2021/5/29
 * 时间: 23:48
 * 内容: Shiro与springboot整合教程！
 * 描述:
 */
@Service
public class PermissionServiceImpl implements PermissionService {

    @Resource
    private PermissionMapper permissionMapper;

    @Override
    public List<String> selectAllPermissions(List<Integer> idLists) {
        List<Permission> permissions = permissionMapper.selectBatchIds(idLists);
        List<String> list = new ArrayList<>();
        for (Permission permission : permissions) {
            list.add(permission.getPermissionName());
        }
        return list;
    }
}
